package com.atguigu.cloud.handler;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;

/**
 * ClassName:MyRequestOriginParser
 * Package:com.atguigu.cloud.handler
 * Description: 描述信息
 *
 * @date:2024/3/6 17:27
 * @author:坤坤
 */
@Component
public class MyRequestOriginParser implements RequestOriginParser
{
    @Override//这里让sentinel获取指定请求参数进行比较  授权
    public String parseOrigin(HttpServletRequest httpServletRequest) {
        return httpServletRequest.getParameter("serverName");
    }
}
